//
//  EzTools.h
//  ezLogin
//
//  Created by 刘跃龙 on 1/7/17.
//  Copyright © 2017 absolutemobile. All rights reserved.
//

#ifndef EzTools_h
#define EzTools_h

#ifdef __cplusplus
#define EZ_BEGIN                     namespace Ez {
#define EZ_END                       }
#define USING_NS_EZ                  using namespace Ez
#define NS_EZ                        ::Ez
#else
#define EZ_BEGIN
#define EZ_END
#define USING_NS_EZ
#define NS_EZ
#endif

#define EZ_SAFE_DELETE(p)           do { delete (p); (p) = NULL; } while(0)
#define EZ_SAFE_DELETE_ARRAY(p)     do { if(p) { delete[] (p); (p) = NULL; } } while(0)
#define EZ_SAFE_FREE(p)             do { if(p) { free(p); (p) = NULL; } } while(0)
#define EZ_BREAK_IF(cond)           if(cond) break

#define EZ_SYNTHESIZE(varType, varName, funName) \
private: varType varName; \
public: virtual varType get##funName(void) const { return varName; } \
public: virtual void set##funName(varType var) { varName = var; }

//EZ_BEGIN
//typedef unsigned char uint8;
//typedef unsigned short uint16;
//typedef unsigned int uint32;
//typedef unsigned long uint64;
//EZ_END

#endif /* EzTools_h */
